package gui;

import java.awt.Color;

/**
 * Panelet som skal vises når programmet startes. Herfra kan man klikke ind på
 * de andre paneler og navigere rundt imellem dem.
 *
 * @author Jeppe
 */
public class StartPanel extends javax.swing.JPanel {

    private final Main main;

    /**
     * Creates new form StartPanel
     *
     * @param main
     */
    public StartPanel(Main main) {
        initComponents();
        this.main = main;
//        main.setSize(MainPanel.getSize().width, MainPanel.getSize().height);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        MainPanel = new javax.swing.JPanel();
        jSeparator1 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        Velkommen_label = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        SøgOpgaverknap = new javax.swing.JButton();
        OpretOpgaveKnap = new javax.swing.JButton();
        Velkommen_label1 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();

        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                formComponentShown(evt);
            }
        });

        MainPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        MainPanel.add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 0, 10, 630));
        MainPanel.add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 60, 280, 20));

        Velkommen_label.setFont(new java.awt.Font("Garamond", 0, 48)); // NOI18N
        Velkommen_label.setForeground(new java.awt.Color(255, 255, 255));
        Velkommen_label.setText("Næstved Vejtransport");
        MainPanel.add(Velkommen_label, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 20, 430, 50));

        jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Pics/Lastbil.png"))); // NOI18N
        jLabel4.setText("jLabel4");
        MainPanel.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 110, 630, 470));

        SøgOpgaverknap.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Pics/Søg Opgave.png"))); // NOI18N
        SøgOpgaverknap.setBorder(null);
        SøgOpgaverknap.setBorderPainted(false);
        SøgOpgaverknap.setContentAreaFilled(false);
        SøgOpgaverknap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SøgOpgaverknapActionPerformed(evt);
            }
        });
        MainPanel.add(SøgOpgaverknap, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, 270, 80));

        OpretOpgaveKnap.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Pics/Opret Opgave.png"))); // NOI18N
        OpretOpgaveKnap.setBorder(null);
        OpretOpgaveKnap.setBorderPainted(false);
        OpretOpgaveKnap.setContentAreaFilled(false);
        OpretOpgaveKnap.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                OpretOpgaveKnapMouseEntered(evt);
            }
        });
        OpretOpgaveKnap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OpretOpgaveKnapActionPerformed(evt);
            }
        });
        MainPanel.add(OpretOpgaveKnap, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 70, 270, 70));

        Velkommen_label1.setFont(new java.awt.Font("Garamond", 0, 36)); // NOI18N
        Velkommen_label1.setForeground(new java.awt.Color(255, 255, 255));
        Velkommen_label1.setText("Velkommen");
        MainPanel.add(Velkommen_label1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 10, 200, 50));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Pics/Baggrund 2.PNG"))); // NOI18N
        MainPanel.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -8, 1020, 640));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(MainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(MainPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void OpretOpgaveKnapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OpretOpgaveKnapActionPerformed
        main.visOpretOpgave();
    }//GEN-LAST:event_OpretOpgaveKnapActionPerformed

    private void SøgOpgaverknapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SøgOpgaverknapActionPerformed
        main.visSøgOpgaver();
    }//GEN-LAST:event_SøgOpgaverknapActionPerformed

    private void OpretOpgaveKnapMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_OpretOpgaveKnapMouseEntered
//        System.out.println("UUUUH det kilder!! :D");
        OpretOpgaveKnap.setForeground(Color.white);
    }//GEN-LAST:event_OpretOpgaveKnapMouseEntered

    private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
        main.setSize(1030, 643);
//        System.out.println("resize: " + getWidth() + " x " + getHeight());
    }//GEN-LAST:event_formComponentShown
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel MainPanel;
    private javax.swing.JButton OpretOpgaveKnap;
    private javax.swing.JButton SøgOpgaverknap;
    private javax.swing.JLabel Velkommen_label;
    private javax.swing.JLabel Velkommen_label1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    // End of variables declaration//GEN-END:variables
}
